package com.xingyue.loginqueryarticle.service;

import com.xingyue.loginqueryarticle.Dao.QueryDao;
import com.xingyue.loginqueryarticle.entity.User;

/**   服务类
 * Created by hdwx on 2016/11/18.
 */
public class QueryService {
//调用封装类 取出封装方法
    private QueryDao dao =new QueryDao();
   /*
  * 用户登录
  * 登录方法 接收实现类
  */
public boolean userLogin(User user){
   //查询用户调用dao
    User user1 = dao.queryAll(user);
//业务逻辑的判断代码
    boolean isLoginOk=false;


if(user1!=null){
    isLoginOk=true;
    dao.updateLastLoginTime(user1);
}
return isLoginOk;
}
public boolean loginlost(String name,String password){

  boolean  ba = dao.loginQuery(name,password);
    return  ba;
}

}
